Shader "FrameWork/Day17Framework"
{
    properties
    {
        _BaseMap("Base Map",2d) = "white"{}
        _BaseColor("Base Color",color) = (1,1,1,1)
    }
    
    subshader
    {
        Tags
        {
            "RenderPipeline" = "UniversalPipeline"
            "RenderType" = "Opaque"
            "Queue" = "Geometry"
        }
        
        HLSLINCLUDE
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"

            CBUFFER_START(UnityPerMaterial)
        
            TEXTURE2D(_BaseMap);SAMPLER(sampler_BaseMap);float4 _BaseMap_ST;
            float4 _BaseColor;
            CBUFFER_END
        ENDHLSL

        pass
        {
            Name "FrameworkDay17"
            Tags
            {
            }
            HLSLPROGRAM
            #pragma vertex UnlitPassVertex
            #pragma fragment UnlitPassFragment

            struct Attributes
            {
                float4 posOS        :POSITION;
                float2 uv           :TEXCOORD0;
                float4 color        :COLOR;
            };

            struct Varyings
            {
                float4 positionCS    :SV_POSITION;
                float2 uv            :TEXCOORD0;
                float4 color         :COLOR;
            };

            Varyings UnlitPassVertex(Attributes IN)
            {
                Varyings OUT = (Varyings)0;
                const VertexPositionInputs position_inputs = GetVertexPositionInputs(IN.posOS.xyz);
                OUT.positionCS = position_inputs.positionCS;
                OUT.uv = TRANSFORM_TEX(IN.uv,_BaseMap);
                OUT.color = IN.color;
                return OUT;
            }

            half4 UnlitPassFragment(Varyings IN) :SV_TARGET
            {
                const half4 baseMap = SAMPLE_TEXTURE2D(_BaseMap,sampler_BaseMap,IN.uv);
                return baseMap * _BaseColor * IN.color;
            }


            ENDHLSL
        }
    }

    Fallback  "Hidden/Universal Render Pipeline/FallbackError"
}
